﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;

//using Microsoft.VisualStudio.TestTools.UnitTesting;

//using Pibby.Core.IO;
//using Pibby.Core.Common;

//namespace Pibby.Core.Tests
//{
//    [TestClass]
//    public class FileSearchStrategyTests
//    {
//        [TestMethod]
//        [ExpectedException (typeof(ContractFailureException))]
//        public void Searching_EmptyFilename_ThrowsException()
//        {
//            FileSearchStrategy finder = new FileSearchStrategy();

//            finder.Find();
//        }

//        [TestMethod]
//        [ExpectedException(typeof(ContractFailureException))]
//        public void Searching_EmptyPaths_ThrowsException()
//        {
//            FileSearchStrategy finder = new FileSearchStrategy();
//            finder.FileName = "NotAbleToFindThisFile.pdf";
//            finder.Find();
//        }

//        [TestMethod]
//        [ExpectedException (typeof (System.IO.FileNotFoundException))]
//        public void SingleFolderSearch_FileNotFound_ThrowsException()
//        {
//            FileSearchStrategy finder = new FileSearchStrategy();

//            IFolder folder = new Stubs.Folder ("C:\\Test", 10);

//            finder.SearchPaths.Add(folder);

//            finder.FileName = "NotAbleToFindThisFile.pdf";

//            finder.Find();

//            Assert.Fail("No file found - should not get here");
//        }


//        [TestMethod]
//        public void SingleFolderSearch_FileFound_ReturnsFileObject()
//        {
//            FileSearchStrategy finder = new FileSearchStrategy();

//            IFolder folder = new Stubs.Folder("C:\\Test", 10);

//            finder.SearchPaths.Add(folder);

//            finder.FileName = "File10.mp3";

//            IFile found = finder.Find();

//            Assert.IsNotNull(found);
//            Assert.AreEqual("C:\\Test\\File10.mp3", found.Path);
//        }

//        [TestMethod]
//        public void StaticFolderSearch_FileFound_ReturnsFileObject()
//        {
//            IFolderCollection folders = new IFolderCollection();
//            folders.Add(new Stubs.Folder("C:\\Test", 10));

//            IFile found = FileSearchStrategy.Find("File8.mp3", folders);

//            Assert.IsNotNull(found);
//            Assert.AreEqual("C:\\Test\\File8.mp3", found.Path);
//        }

//        [TestMethod]
//        public void StaticSingleFolderSearch_FileFound_ReturnsFileObject()
//        {
//            IFolder folder = new Stubs.Folder("C:\\Test", 10);

//            IFile found = FileSearchStrategy.Find("File1.mp3", folder);

//            Assert.IsNotNull(found);
//            Assert.AreEqual("C:\\Test\\File1.mp3", found.Path);
//        }

//        [TestMethod]
//        public void MultiFolderSearch_FileFound_ReturnsFileObject()
//        {
//            FileSearchStrategy finder = new FileSearchStrategy();

//            finder.SearchPaths.Add(new Stubs.Folder("C:\\Windows", 30));
//            finder.SearchPaths.Add(new Stubs.Folder("D:\\Data", 100));
//            finder.SearchPaths.Add(new Stubs.Folder("F:\\Backup", 20));

//            finder.FileName = "File99.mp3";

//            IFile found = finder.Find();

//            Assert.IsNotNull(found);
//            Assert.AreEqual("D:\\Data\\File99.mp3", found.Path);
//        }

//    }
//}
